﻿#region Copyrights Notice
//©2009 Microsoft Corporation.  All rights reserved.
#endregion

using System;
using System.Security.Cryptography;
using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography;

namespace Microsoft.CISG.BitlockerRecovery.BL
{
    public static class Encryption
    {
        private const string symmProvider = "symprovider";

        public static string DecryptBitlocker(byte[] encryptedValue)
        {
            try
            {
                System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();

                byte[] decryptedvalue = Cryptographer.DecryptSymmetric(symmProvider, encryptedValue);
                string str = enc.GetString(decryptedvalue);

                return str;

            }
            catch 
            {
                throw;
            }

        }

    }
}
